package com.ruoyi.project.cltmanage.charge.mapper;


import com.ruoyi.project.cltmanage.domain.CltCharge;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ChargeMapper {
    //查询订单信息
    @Select("select dct_charge_id,dct_order_id,dct_order_code,dct_main,dct_patient_id,dct_patient_name,dct_office_name,dct_doctor_name" +
            ",dct_doctor_advice,dct_prescription_type,dct_prescription_name,dct_prescription_single_price,dct_prescription_num" +
            ",dct_prescription_cost,dct_time,dct_remark,dct_cost_status,dct_cost_type from dct_charge where dct_order_id = #{param1}")
    List<CltCharge> selectID (String dctOrderId);

    @Select("select dct_charge_id,dct_order_id,dct_order_code,dct_main,dct_patient_id,dct_patient_name,dct_office_name,dct_doctor_name" +
            ",dct_doctor_advice,dct_prescription_type,dct_prescription_name,dct_prescription_single_price,dct_prescription_num" +
            ",dct_prescription_cost,dct_time,dct_remark,dct_cost_status,dct_cost_type from dct_charge " +
            "where dct_prescription_type = #{param1} and dct_order_id = #{param2} and dct_cost_status=0")
    List<CltCharge> selectNum(Integer type ,String dctOrderId);

    @Select("select dct_prescription_cost from dct_charge where dct_prescription_type=#{param1}")
    List<CltCharge> selectCost(Integer cost);

    @Select("select dct_prescription_type from dct_charge order by dct_prescription_type")
    List<CltCharge> selectOne();

    @Update("update dct_charge set dct_cost_status=1 , dct_cost_type=2 where dct_charge_id=#{param1}")
    int updateCash(String id);

    @Update("update dct_charge set dct_cost_status=1 , dct_cost_type=1 where dct_charge_id=#{param1}")
    int updateWed(String id);
}

